Worker threads may be used to execute functions from several services, applications, or other sources in an operating system or multi-threaded programming environment. The functions executed by a worker thread may come from several different sources and perform widely varying tasks.
Many functions, especially in an operating system, may operate using different priorities, assume different impersonations, or operate in different activation contexts. If a function terminates improperly or as a result of sloppy programming, such states may be improperly reset, which may cause various problems, including race conditions, deadlocks, livelocks, starvation, or other problems.